#include "packet.h"

#include "DI_TypesPublic.h"
#include <stdlib.h>
#include <string.h>
#include "usart.h"
#include "McuMsg.h"

McuMsg g_msgRet;
int SendUpgradeAck(uint16_t reqId)
{
    #if 0
	memset(&g_msgRet, 0, sizeof(g_msgRet));
	MakeMcuMsg(&g_msgRet, NULL, 0, DI_Ok, MSG_UPGRADE_Ack, reqId);
	HAL_UART_Transmit(&huart6, (uint8_t*)&g_msgRet, g_msgRet.header.len + sizeof(McuMsgHeader_t), 100);
    #endif
    SendPacket(NULL, 0, DI_Ok, MSG_UPGRADE_Ack, reqId);
    return 0;
}

int SendPacket(uint8_t *buf, uint16_t len, DI_RET code, McuMsgType msgType, uint16_t reqId)
{
	memset(&g_msgRet, 0, sizeof(g_msgRet));
	MakeMcuMsg(&g_msgRet, buf, len, code, msgType, reqId);
	//HAL_UART_Transmit(&huart6, (uint8_t*)&g_msgRet, len + sizeof(McuMsgHeader), 100);
    return 0;
}

